//
//  RealTimeViewController.m
//  mendianjieke
//
//  Created by 响当当 on 7/30/19.
//  Copyright © 2019 dongzheng. All rights reserved.
//

#import "RealTimeViewController.h"
#import "RealTimeView.h"

@interface RealTimeViewController ()
@property (nonatomic, strong)RealTimeView *realTimeView;
@end

@implementation RealTimeViewController


- (RealTimeView *)realTimeView
{
    if (!_realTimeView)
    {
        _realTimeView = [[RealTimeView alloc]initWithFrame:CGRectMake(0,NAVIBAR_HEIGHT,SCREEN_WIDTH,SCREEN_HEIGHT-NAVIBAR_HEIGHT-TABBAR_HEIGHT)];
        [_realTimeView getInfo:nil];
    }
    return _realTimeView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
    
    [self setTitle:@"实时"];

    [self.view addSubview:self.realTimeView];
    
    [self getInfo:@"0"];
}


- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}


- (void)getInfo:(NSString *)type
{
    NSDictionary *pramaters = @{
                                @"type" : type
                                };
    
    WeakSelf(self)
    [infoManager getTimeInfo:pramaters sucess:^(id  _Nonnull acceptData) {
        [weakSelf.realTimeView getInfo:acceptData];
    } fail:^(NSError * _Nullable error) {
        
    }];
}
@end
